#include <iostream>
#include "include/rpcServer.h"
#include "include/userCenterDao.h"
#include <boost/asio.hpp>
#include <thread>
#include "./include/conf_reader.h"
int main()
{
    conf_reader::get_conf_reader_instance();
    

    boost::asio::io_context context;
    boost::asio::signal_set signals(context,SIGINT,SIGTERM);
    signals.async_wait([&context](const boost::system::error_code& error, int signal_number){
        if(error){
            //不会走到这里
            return;
        }
        rpcServer::get_instance()->stop();
        context.stop();

    });

    std::thread _thread([&context](){
        context.run();
    });


    userCenterDao::get_instance();
    rpcServer::get_instance()->start();

    _thread.join();
    



}
